When creating rich user interfaces in web pages, using tools such as HTML (HyperText Markup Language), DHTML (Dynamic HyperText Markup Language), JavaScript and CSS (Cascading Style Sheets)(all zero footprint, core browser technologies), the developer needs to create data objects on a page beyond embedding strings inside HTML tags. Several methods have been used that can be classified in 2 areas: creating XML data islands, or creating complex nested Arrays in JavaScript.
Such solutions have problems. Although XML streams can benefit from a formal schema (expressed as an XSD), XML data islands are not equally supported in all browsers. Second, XML data islands generally require significantly more processing power than plain JavaScript data structures. Finally, XML streams are often verbose and create a large transmission overhead over the plain data, causing a bandwidth consumption problem. On the other hand, JavaScript data structures can be made much more compact, are easy to manipulate, and perform well. But JavaScript variables and Arrays suffer from a lack of formalism: typing information for instance is often lost because JavaScript is not typed.
More importantly, the models used to describe the server-side data are typically different from those used to describe the client-side data. Often, the models for the client-side data are created in an ad-hoc fashion, without real formality. The lack of symmetry between the server-side data models and the client-side data models in modern web applications is something that is quite particular to those types of applications, and something that you do not see in other application paradigms such as GUI (graphical user interface) applications built using the common Model View Controller pattern. This issue is often cited as a reason why web applications can become difficult to maintain over time, given their fundamentally unstructured approach to data modeling on the browser.
When creating rich and interactive Web pages, it is important to have data locally represented in some way in the browser. A popular solution has been to use XML Data Islands (which appeared first in Microsoft's Internet Explorer browser V5) to represent that data. The benefits are clear: the data is represented in a formal way that matches a given model (whether expressed as an XML Schema or not), and gives the code on the web page an infrastructure to access and modify that data. However, representing data in XML has a number of shortcomings:
XML streams are large compared to the data they contain, and so, they consume more bandwidth than necessary and cause Web pages to load more slowly; XML support sees varying degrees of quality of implementation and performance across a number of browsers and platforms; and most importantly, XML by definition offers a declarative programming model that causes a shift compared to the programming model used n server-side Java-based applications which is procedural.